Jeg har prøvet at gøre din kode mere overskueligt, men du starter en tabel, som afsluttes flere steder?
- <?php
-
- session_start();
-
- include("connect.php");
-
- if($_SESSION['loget_in'] == 1)
- {
-
- ?>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>.::22Tirsdags rediger side::.</title>
- <style type="text/css">
- body {
- margin-left: 0px;
- margin-top: 0px;
- margin-right: 0px;
- margin-bottom: 0px;
- background-color:#999;
- }
-
- .copyright {
- font-family: Verdana, Geneva, sans-serif;
- color: #FFF;
- }
-
- #login {
- font-family: Verdana, Geneva, sans-serif;
- font-size: 12px;
- color: #020001;
- }
- </style>
- </head>
- <body>
- <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" z-index="-1" background="bg.png">
- <tr>
- <td align="center" valign="top"><table width="840" height="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td bgcolor="#FFFBF0" background="administration.png" height="93px" min-height="93px" max-height="93px"></td>
- </tr>
- <tr>
- <td bgcolor="#D6D6D6" max-height="20px" min-height="20px" height="20px"><table width="840" height="20px" background="menubg.png" cellspacing="0" cellpadding="0">
- <tr>
- <td>
- <?php
-
- $siderquery = mysql_query("SELECT * FROM sider ORDER BY id ASC");
-
- while($sidedata = mysql_fetch_assoc($siderquery))
- {
- print "| <a href=\"/?side=".$sidedata[url]."\">".$sidedata[overskrift]."</a> ";
- }
- ?>
-
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td bgcolor="#FFFBF0" valign="top">
-
- <?php
-
- if(isset($_GET['ret'], $_GET['id']))
- {
- $id = $_GET['id'];
- $getfromid = mysql_query("SELECT * FROM sider ORDER BY id WHERE id = '$id'")or die(mysql_error());
-
- while($select = mysql_fetch_array($getfromid))
- {
- $id = $select[id];
- $overskrift = $select[overskrift];
- $indhold = $select[indhold];
- $url = $select[url];
- }
-
- ?>
-
- <form action="?do=rediger" method="POST">
- Overskrift:<br>
- <input type="input" name="retoverskrift" value="<?PHP echo "$overskrift"; ?>><br>
- Indhold:<br>
- <textarea style="width:800px; height: 450px;" name="retindhold">
- <?php
- echo "$indhold";
- ?>
- </textarea><br>
- URL: (fx: ?side=php)<br>
- projekt.wizzo.dk/?side= <input type="input" name="returl" value="<?php echo "$url"; ?>"><br>
- <input type="submit" value="Rediger">
- </form>
-
- <?php
- }
- else
- {
- if($_GET['do'] == "rediger")
- {
- mysql_query("update sider set overskrift='$retoverskrift', indhold='$retindhold', url='$returl' WHERE id = '$id'") or die(mysql_error());
-
- echo "<font color=green>Siden er blevet opdateret</font>";
- }
- else
- {
- echo "<font color=red>Siden er ikke blevet opdateret</font>";
- }
-
- $resultat = mysql_query("select * FROM sider order by id desc");
-
- while ($row = mysql_fetch_array($resultat))
- {
- echo "<br>";
- echo "$row[overskrift]";
- echo "<br>";
-
- ?>
-
- <a href="retside.php?ret=<? echo "$row[id]" ?>">Ret</a><br>
-
- <?
- }
- }
- ?>
-
- </td>
- </tr>
- <tr>
- <td align="center" bgcolor="#2A9FAA" class="copyright">
- Copyright © 8. klasse projektuge. uge13. Andreas, Abbas, Mads L og Kristian
-
- <div id="login">
-
- <?php
-
- if($_SESSION['loget_in'] == 1)
- {
- echo $_SESSION[Username];
-
- ?>
-
- <a href="admin.php">Admin siden</a>
- <a href="logud.php">Log ud</a></div>
-
- <?php
- }
-
- ?>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </body>
- </html>
- <?php
- }
- else
- {
- echo "Hvad med lige at logge ind...";
- echo "<br>";
- echo "<a href=adminlogin.php>Login her</a>";
- }
- ?>
Desuden hvordan ser dit link ud til den side du retter på?